<template>
  <div>
    <div>{{ sex ? "男" : "女" }}</div>
    <button @click="fn">切换性别</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      sex: 1,
    };
  },
  methods: {
    fn() {
      this.sex = this.sex ? 0 : 1;
    },
  },
};
</script>

<style scoped lang="less"></style>
